import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib as mpl
mpl.rcParams['font.sans-serif'] = ['KaiTi']
mpl.rcParams['font.serif'] = ['KaiTi']
mpl.rcParams['font.size'] =8


value_1=[1, 0, 0, 0, 1, 0, 0, 0, 0, 6, 0, 1, 0, 1, 9, 20, 27, 64, 50, 44, 78, 29, 47, 15]
value_2=[0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 5, 4, 1, 2, 9, 31, 32, 70, 82, 88, 114, 68, 49, 15]
value_3=[0, 0, 1, 1, 6, 1, 5, 2, 5, 5, 1, 12, 12, 10, 11, 60, 73, 157, 145, 164, 189, 84, 96, 39]
value_4=[0, 0, 1, 16, 4, 1, 4, 1, 9, 10, 8, 7, 34, 7, 9, 127, 156, 243, 260, 317, 306, 190, 178, 66]
value_5=[0, 1, 6, 13, 6, 12, 2, 8, 8, 19, 19, 23, 33, 33, 54, 199, 269, 343, 499, 692, 780, 425, 367, 188]

#2 创建画布
width=0.2
plt.figure()
#3 绘图
plt.bar([i-2*width for i in range(1997,2021)],value_1,width=width,label="分数=1")#
plt.bar([i-1*width for i in range(1997,2021)],value_2,width=width,label="分数=2")#
plt.bar([i for i in range(1997,2021)],value_3,width=width,label="分数=3")#
plt.bar([i+1*width for i in range(1997,2021)],value_4,width=width,label="分数=4")#
plt.bar([i+2*width for i in range(1997,2021)],value_5,width=width,label="分数=5")#
plt.legend()
plt.xticks([i for i in range(1997,2021)])#,movie_names)#这个是x轴的标题
plt.show()